#ifndef LONGKEY_BASE_CONSTANTS_H_
#define LONGKEY_BASE_CONSTANTS_H_

// Application name.
// Use the localized IDS_PRODUCT_DISPLAY_NAME or the formatted
// IDS_INSTALLER_DISPLAY_NAME instead when string is displayed to user.
// kAppName == "Longkey PCAgent"
const TCHAR* const kAppName = _T("Longkey PCAgent");

#define APP_NAME_IDENTIFIER _T("lk-pcagent")

#define MAIN_EXE_BASE_NAME _T("lk-pcagent")

#define SHORT_COMPANY_NAME _T("Longkey")
const TCHAR* const kShortCompanyName = SHORT_COMPANY_NAME;

#define PRODUCT_NAME _T("PCAgent")


const TCHAR* const kPCAgentShellFileName         = MAIN_EXE_BASE_NAME _T(".exe");
const TCHAR* const kPCAgentResourceDllNameFormat = _T("pcagentres_%s.dll");
const TCHAR* const kPSFileNameMachine  = _T("psmachine.dll");
const TCHAR* const kPSFileNameUser     = _T("psuser.dll");

//
// PCAgent's app ID
//
#define PCATENT_APP_ID _T("{3AF0D4E4-6BE1-4761-B2B4-B1FA25848D19}")
const TCHAR* const kPCAgentAppId = PCATENT_APP_ID;
const GUID kPCAgentGuid = 
{ 0x3af0d4e4, 0x6be1, 0x4761, { 0xb2, 0xb4, 0xb1, 0xfa, 0x25, 0x84, 0x8d, 0x19 } };


//
// Directory names
//
#define PCAGENT_REL_LOG_DIR _T("\\log")

//
// Registry keys and values
//
#define MACHINE_KEY_NAME _T("HKLM")
#define MACHINE_KEY MACHINE_KEY_NAME _T("\\")
#define USER_KEY_NAME _T("HKCU")
#define USER_KEY USER_KEY_NAME _T("\\")
#define USERS_KEY _T("HKU\\")

#define COMPANY_MAIN_KEY _T("Software\\") SHORT_COMPANY_NAME _T("\\")
#define PCAGENT_MAIN_KEY COMPANY_MAIN_KEY PRODUCT_NAME _T("\\")
#define PCAGENT_REG_RELATIVE_CLIENTS PCAGENT_MAIN_KEY _T("Clients\\")
#define PCAGENT_REG_RELATIVE_CLIENT_STATE PCAGENT_MAIN_KEY _T("ClientState\\")

#define USER_REG_UPDATE USER_KEY PCAGENT_MAIN_KEY
#define USER_REG_CLIENTS USER_KEY PCAGENT_REG_RELATIVE_CLIENTS
#define USER_REG_CLIENTS_PCAGENT  USER_REG_CLIENTS PCATENT_APP_ID
#define USER_REG_CLIENT_STATE USER_KEY PCAGENT_REG_RELATIVE_CLIENT_STATE
#define USER_REG_CLIENT_STATE_PCAGENT USER_REG_CLIENT_STATE PCATENT_APP_ID

#define MACHINE_REG_UPDATE MACHINE_KEY PCAGENT_MAIN_KEY
#define MACHINE_REG_CLIENTS MACHINE_KEY PCAGENT_REG_RELATIVE_CLIENTS
#define MACHINE_REG_CLIENTS_PCAGENT  MACHINE_REG_CLIENTS PCATENT_APP_ID
#define MACHINE_REG_CLIENT_STATE MACHINE_KEY PCAGENT_REG_RELATIVE_CLIENT_STATE
#define MACHINE_REG_CLIENT_STATE_PCAGENT MACHINE_REG_CLIENT_STATE PCATENT_APP_ID

// Specifies whether a tristate item has a value and if so what the value is.
enum Tristate {
	TRISTATE_FALSE,
	TRISTATE_TRUE,
	TRISTATE_NONE
};

// Number of periods to use when abbreviating URLs
#define kAbbreviationPeriodLength 3

// The Unicode "Byte Order Marker" character.  This is the native
// encoding, i.e. after conversion from UTF-8 or whatever.
const wchar_t kUnicodeBom = 0xFEFF;

// Using these constants will make ATL load the
// typelib directly from a DLL instead of looking up typelib
// registration in registry.
const DWORD kMajorTypeLibVersion = 0xFFFF;
const DWORD kMinorTypeLibVersion = 0xFFFF;

const TCHAR* const kLocalSystemSid = _T("S-1-5-18");

// Name of the language key-value pair inside the version resource.
const TCHAR* const kLanguageVersionName = _T("LanguageId");

#endif	// LONGKEY_BASE_CONSTANTS_H_